package com.clz.hyperit.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

import com.clz.hyperit.util.IdAnnotationin;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "note", catalog = "hyperit")
public class Note {

	@IdAnnotationin
	private Integer id;
	private String title;
	private String createtime;
	private Integer userDetail_id;
	private Integer reading;	//浏览量
	private Integer collecting;  //收藏数
	private String content_html;
	private String content_md;
	private Integer status;//0草稿1已经发布
	public Note() {
	
	}
	
	public Note(Integer id, String createtime) {
	
		this.id = id;
		this.createtime = createtime;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "title")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Generated(GenerationTime.INSERT)
	@Column(name = "createtime")
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	@Column(name = "userdetail_id")
	public Integer getUserDetail_id() {
		return userDetail_id;
	}
	public void setUserDetail_id(Integer userDetail_id) {
		this.userDetail_id = userDetail_id;
	}
	@Column(name = "reading")
	public Integer getReading() {
		return reading;
	}
	public void setReading(Integer reading) {
		this.reading = reading;
	}
	@Column(name = "collecting")
	public Integer getCollecting() {
		return collecting;
	}
	public void setCollecting(Integer collecting) {
		this.collecting = collecting;
	}
	@Column(name = "content_html")
	public String getContent_html() {
		return content_html;
	}
	public void setContent_html(String content_html) {
		this.content_html = content_html;
	}
	@Column(name = "content_md")
	public String getContent_md() {
		return content_md;
	}
	public void setContent_md(String content_md) {
		this.content_md = content_md;
	}
	@Column(name = "status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Note [id=" + id + ", title=" + title + ", createtime="
				+ createtime + ", userDetail_id=" + userDetail_id
				+ ", reading=" + reading + ", collecting=" + collecting
				+ ", content_html=" + content_html + ", content_md="
				+ content_md + ", status=" + status + "]";
	}




	
}
